#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
export PATH

# demo
# [ sql ] [ SQL ] SELECT * FROM `sp_sub_log` WHERE  `u_id` = 1452  AND `data_id` = 698666 LIMIT 1 [ RunTime:0.007923s ]
# 查找 执行时间大于1s的sql
cat /home/taoshanghaoke/runtime/log/201907/*13_sql.log | awk '{ bb=gsub(/s|RunTime:/, "", $(NF-1)); if(bb>0 && $(NF-1) > 1.0  ){ print $0; } }' > a.txt	